package com.senthink.gl.business.forgetpw;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.senthink.gl.business.common.entity.BaseEntity;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.Date;

/**
 * @author yuanpeng@senthink.com
 * @data 2018-02-28 10:54
 */

@Entity
@Table(name = "gl_verify_code")
@Getter
@Setter
public class VerifyCode extends BaseEntity<Long>{

    /**
     * 账号
     */
    private String account;

    /**
     * 图形验证码文字
     */
    private String code;

    /**
     * 获取次数
     */
    private int count = 0;

    /**
     * 是否经过检查
     */
    private boolean checkCode = false;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Temporal(TemporalType.DATE)
    @Column(name = "create_time")
    protected Date createTime;

    @PrePersist
    protected void onCreate() {
        createTime = new Date();
    }
}
